﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using BaseData.Common;
using BaseData.UI;
using TaxData.SysConfig;
using TaxEntity.SysConfig;
using TaxEntity.User;

namespace TaxBiz.SysConfig
{
    /// <summary>
    /// 地段逻辑层
    /// </summary>
    public class DiDuanBiz
    {
        private DiDuanData ddd = new DiDuanData();

        /// <summary>
        /// 获取地段信息实体
        /// </summary>
        public DiDuanEntity GetEntityById(int ID)
        {
            DiDuanEntity model = ddd.GetEntityById(ID);
            return model;
        }

        /// <summary>
        /// 删除地段
        /// </summary>
        public bool Delete(int ID, UserEntity optUser)
        {
            bool isSucc = ddd.Delete(ID);
            return isSucc;
        }

        /// <summary>
        /// 获取地段列表
        /// </summary>
        public DataTable GetList(string strWhere, int pageSize, int page, ref int allCount)
        {
            DataTable dt = ddd.GetList(strWhere, pageSize, page, ref allCount);
            return dt;
        }

        /// <summary>
        /// 获取地段列表
        /// </summary>
        public DataTable GetList(int jiedaoID)
        {
            DataTable dt = ddd.GetList(jiedaoID);
            return dt;
        }

        /// <summary>
        /// 获取地段列表
        /// </summary>
        public DataTable GetList()
        {
            DataTable dt = ddd.GetList();
            return dt;
        }

        /// <summary>
        /// 增加地段
        /// </summary>
        /// <param name="model">地段信息实体</param>
        /// <param name="optUser">操作人</param>
        /// <returns>成功地段编号,失败返回0</returns>
        public int Add(DiDuanEntity model, UserEntity optUser)
        {
            int id = ddd.Add(model);
            return id;
        }

        /// <summary>
        /// 修改地段信息
        /// </summary>
        /// <param name="model">修改地段</param>
        /// <param name="optUser">操作人</param>
        /// <returns>操作结果</returns>
        public bool Update(DiDuanEntity model, UserEntity optUser)
        {
            bool isSucc = ddd.Update(model);
            return isSucc;
        }
    }
}